window.onload = function () {
    console.log(JSON.parse(localStorage.getItem('dataFromBackend')));
    console.log(JSON.parse(localStorage.getItem('nickname')))

    const name = JSON.parse(localStorage.getItem('nickname'));
    if (name) {
        document.querySelector('.login').hidden = true;
        document.querySelector('.logout').hidden = false;
    } else {
        document.querySelector('.login').hidden = false;
        document.querySelector('.logout').hidden = true;
    }
    document.querySelector('.user').innerHTML = name;
    console.log(name)

    // 清除本地存储  登出
    function del() {
        localStorage.clear();
    }
    document.querySelector('.chu').onclick = del();
}